package org.csu.sei.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import org.csu.sei.common.PageRes;
import org.csu.sei.entity.DTO.MonCount;
import org.csu.sei.entity.News;
import org.csu.sei.entity.NewsContent;

import java.util.List;

public interface INewsService extends IService<News> {

    News queryNews(Long id);

    Long insertNews(News news);

    int deleteNews(Long id);

    int updateNewsAndContent(News news,NewsContent newsContent);

    PageRes querySameCategoryNews(Long catId,int page,int limit,boolean selectInviable);

    PageRes queryNewsByName(String name, int page, int limit,boolean selectInviable);

    void changeStatus(Long id);

    int insertNewsAndContent(News news,NewsContent newsContent);

    JSONObject queryLatestNews(int page, int qty,boolean selectInviable);

    JSONObject queryTeacherInfoList();

    //批量删除
    int deleteSome(List<Long> idList);

    //批量改变状态
    int setLook(List<Long> idList, int status);

    PageRes queryNewsListBySomeCondition(int page,int limit,List<Long> catId,String title,List<Integer> status,Long id);

    int changeOrder(Long id,int order);

    //阅读数加一
    void countReader(Long id);

    // 获取所有的category的数量
    int getCount();



}
